#ifndef __RenderWindow_H__
#define __RenderWindow_H__

#include "glare.core.Prerequisites.h"
#include "glare.core.RenderTarget.h"
#include "glare.core.ConfigOption.h"

namespace Glare {

	class RenderWindow : public RenderTarget
	{
	public : RenderWindow(PlatformWindow* platform_window);
	public : virtual ~RenderWindow();

	// TODO: probably move this to RenderTarget base, 
	// so we can assert that a RenderTarget is initialized before it is used
	public : void Initialize();
	protected : virtual void InitializeImpl() = 0;

	public : virtual void Present() = 0;

	public : const uint GetCanvasWidth() const;
	public : const uint GetCanvasHeight() const;

	public : PlatformWindow* GetPlatformWindow() const;

	public : const bool& IsInitialized() const;

	// <Settings>
	public : const bool& IsFullscreen() const;
	public : void SetFullscreen(const bool& fullscreen);
	protected : virtual void SetFullscreenImpl(const bool& fullscreen) = 0;

	public : const uint& GetPresentSyncInterval() const;
	public : void SetPresentSyncInterval(const uint& interval);
	// </Settings>

	public : bool SetOption(const string& name, const string& value);
	public : bool SetOption(const string& name, const int& value);

	protected : virtual void SetOptionImpl(const string& name, const string& value) = 0;

	protected : bool AddConfigOption(const ConfigOption& option);
	protected : bool AddConfigOption(const string& name, const string& initial_value, const bool& immutable, const string possible_values[], int num_values, const string& info_url);

#if GLARE_CXX_11_FEATURES_ENABLED
	protected : bool AddConfigOption(const string& name, const string& initial_value, const bool& immutable, std::initializer_list<string> possible_values, const string& info_url);
#endif

	public : const ConfigOptionMap& GetOptions() const;

	private : bool _is_initialized;
	private : bool _is_fullscreen;

	// OPTIONS
	private : uint _present_sync_interval;

	private : ConfigOptionMap _config_options;
	private : PlatformWindow* _platform_window;
	};

}

#endif
